import matplotlib.pyplot as plt
from numpy import *

file1=open('oscul1.txt','r')
file2=open('oscul2.txt','r')

x = [];
vx = [];
y = [];
vy = [];
z = [];
vz = [];
R = [];
V = [];

c1 = [];
c2 = [];
c3 = [];
C = [];

f1 = [];
f2 = [];
f3 = [];
F = [];
H = [];

e = [];
a = [];
i = [];
omega = [];
w = [];
V0 = [];

x2 = [];
vx2 = [];
y2 = [];
vy2 = [];
z2 = [];
vz2 = [];
R2 = [];
V2 = [];

c12 = [];
c22 = [];
c32 = [];
C2 = [];

f12 = [];
f22 = [];
f32 = [];
F2 = [];
H2 = [];

e2 = [];
a2 = [];
i2 = [];
omega2 = [];
w2 = [];
V02 = [];

t = [];
t2 = [];


for line in file2:
    line = line.replace(',', '.')
    line = line.strip()
    vals = line.split(' ')

    x2.append(float(vals[0]))
    vx2.append(float(vals[1]))
    y2.append(float(vals[2]))
    vy2.append(float(vals[3]))
    z2.append(float(vals[4]))
    vz2.append(float(vals[5]))

    R2.append(float(vals[6]))
    V2.append(float(vals[7]))

    c12.append(float(vals[8]))
    c22.append(float(vals[9]))
    c32.append(float(vals[10]))
    C2.append(float(vals[11]))

    f12.append(float(vals[12]))
    f22.append(float(vals[13]))
    f32.append(float(vals[14]))
    F2.append(float(vals[15]))
    H2.append(float(vals[16]))

    e2.append(float(vals[17]))
    a2.append(float(vals[18]))
    i2.append(float(vals[19]))
    omega2.append(float(vals[20]))
    w2.append(float(vals[21]))
    V02.append(float(vals[22]))
    t2.append(float(vals[23]))


for line in file1:
    line = line.replace(',', '.')
    line = line.strip()
    vals = line.split(' ')

    x.append(float(vals[0]))
    vx.append(float(vals[1]))
    y.append(float(vals[2]))
    vy.append(float(vals[3]))
    z.append(float(vals[4]))
    vz.append(float(vals[5]))

    R.append(float(vals[6]))
    V.append(float(vals[7]))

    c1.append(float(vals[8]))
    c2.append(float(vals[9]))
    c3.append(float(vals[10]))
    C.append(float(vals[11]))

    f1.append(float(vals[12]))
    f2.append(float(vals[13]))
    f3.append(float(vals[14]))
    F.append(float(vals[15]))
    H.append(float(vals[16]))

    e.append(float(vals[17]))
    a.append(float(vals[18]))
    i.append(float(vals[19]))
    omega.append(float(vals[20]))
    w.append(float(vals[21]))
    V0.append(float(vals[22]))
    t.append(float(vals[23]))


plt.figure(1)

plt.title("t - red-x, green-y, blue-z, yellow-r")

plt.plot(t, x, c='r')
plt.plot(t, y, c='g')
plt.plot(t, z, c='b')
plt.plot(t, R, c='y')

plt.plot(t2, x2)
plt.plot(t2, y2)
plt.plot(t2, z2)
plt.plot(t2, R2)


plt.figure(2)
plt.title("t red-vx, green-vy, blue-vz, yellow-V")
plt.plot(t, vx, c='r')
plt.plot(t, vy, c='g')
plt.plot(t, vz, c='b')
plt.plot(t, V, c='y')

plt.plot(t2, vx2)
plt.plot(t2, vy2)
plt.plot(t2, vz2)
plt.plot(t2, V2)


plt.figure(3)
plt.title("t - red-c1, green-c2, blue-c3, yellow-c")
plt.plot(t, c1, c='r')
plt.plot(t, c2, c='g')
plt.plot(t, c3, c='b')
plt.plot(t, C, c='y')

plt.plot(t2, c12)
plt.plot(t2, c22)
plt.plot(t2, c32)
plt.plot(t2, C2)

plt.figure(4)
plt.title("red-f1, green-f2, blue-f3, yellow-f")
plt.plot(t, f1, c='r')
plt.plot(t, f2, c='g')
plt.plot(t, f3, c='b')
plt.plot(t, F, c='y')
plt.plot(t2, f12)
plt.plot(t2, f22)
plt.plot(t2, f32)
plt.plot(t2, F2)

plt.figure(11)
plt.title('H')
plt.plot(t, H, c='m')
plt.plot(t2, H2, c='m')


plt.figure(5)
plt.title("t - e");
plt.plot(t, e);
plt.plot(t2, e2);

plt.figure(6)
plt.title("t - a");
plt.plot(t, a, c='r');
plt.plot(t2, a2, c='b');
plt.plot(t2, e, c='b');


plt.figure(7)
plt.title("t - i");
plt.plot(t, i);
plt.plot(t2,i2);

plt.figure(8)
plt.title("t - omega");
plt.plot(t, omega);
plt.plot(t2, omega2);

plt.figure(9)
plt.title("t - w");
plt.plot(t, w);
plt.plot(t2, w2);

plt.figure(10)
plt.title("t - anomaly");
plt.plot(t, V0);
plt.plot(t2, V02);





plt.show()
